﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace ABCTile.Models
{
    public class User
    {
        [Required(ErrorMessage = "User ID is required")]
        [Display(Name = "User ID")]
        public string UserID { get; set; }

        [Required(ErrorMessage = "Password is required")]
        [Display(Name = "User Password")]
        [DataType(DataType.Password)]
        public string UserPW { get; set; }

        [Required(ErrorMessage = "First Name is required")]
        [Display(Name = "First Name")]
        public string UserFname { get; set; }

        [Display(Name = "Middle Name")]
        public string UserMname { get; set; }

        [Required(ErrorMessage = "Last Name is required")]
        [Display(Name = "Last Name")]
        public string UserLname { get; set; }

        [Required(ErrorMessage = "E-mail is required")]
        [Display(Name = "E-Mail")]
        [DataType(DataType.EmailAddress)]
        public string UserEmail { get; set; }

        public string FullName
        {
            get
            {
                return UserLname + ", " + UserFname;
            }
        }

        //Foriegn key properties
        public virtual int RoleID { get; set; }

        public virtual Role Role { get; set; }
    }
}